export const TICKET_STATUS = [
  { label: '待审核', value: 0, type: 'info' },
  { label: '审核未通过', value: 1, type: 'error' },
  { label: '待处理', value: 2, type: 'warning' },
  { label: '处理中', value: 3, type: 'info' },
  { label: '不予受理', value: 4, type: 'error' },
  { label: '已撤回', value: 5, type: 'success' },
  { label: '调解不成', value: 6, type: 'info' },
  { label: '已办结', value: 7, type: 'success' }
]

export default {
  table: 'ticket',
  columns: [
    {
      key: 'id'
    },
    {
      title: '事件编号',
      key: 'code'
    },
    {
      title: '事件名称',
      key: 'title'
    },
    {
      title: '事件来源',
      key: 'ticket_source.content'
    },
    {
      title: '所属部门',
      key: 'department.name'
    },
    {
      title: '事件状态',
      key: 'status',
      options: TICKET_STATUS
    },
    {
      title: '录入时间',
      key: 'create_at',
      type: 'date',
      sorter: true
    }
  ],
  queryOptions: {
    'ticket_source.id': {
      title: '事件来源',
      type: 'async',
      table: 'ticket_source',
      labelKey: 'content',
      valueKey: 'id',
      multiple: true
    },
    status: {
      type: 'select',
      multiple: true
    },
    create_at: {
      type: 'daterange',
      format: 'yyyy-MM-dd'
    }
  }
}